package com.book.controller;

import com.book.po.Book;
import com.book.po.BorrowInfo;
import com.book.service.bookService;
import com.book.service.borrowInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;

import java.util.List;

@Controller
@RequestMapping("/borrowInfo")
public class borrowInfoController {
    @Autowired
    private borrowInfoService borrowInfoService;

    @RequestMapping("/borrowInfo_select")
    public String book_select(RedirectAttributes  model, Integer borrowId){
        BorrowInfo borrowInfo = borrowInfoService.borrowInfo_select(borrowId);
        if (borrowInfo!=null){
            model.addFlashAttribute("borrowInfo",borrowInfo);
            model.addFlashAttribute("msg","");
            return "redirect:/manage/borrowSearch";
        }else {
            model.addFlashAttribute("msg","没有查找到对应信息！");
            return "redirect:/manage/borrowSearch";
        }
    }


}
